#include <iostream>
#include <vector>
#include <string>

using namespace std;

const int N = 1e6 + 10;

// A >= B ?
bool cmp(vector<int> &A, vector<int> &B)
{
    if (A.size() > B.size())
        return true;
    else if (A.size() < B.size())
        return false;
    for (int i = A.size() - 1; i >= 0; i--)
        if (A.at(i) > B.at(i))
            return true;
        else if (A.at(i) < B.at(i))
            return false;
    return true;
}

vector<int> sub(vector<int> &A, vector<int> &B)
{
    vector<int> C;
    for (int i = 0, t = 0; i < A.size(); i++)
    {
        t = A.at(i) - t;
        if (i < B.size())
            t -= B.at(i);
        C.push_back((t + 10) % 10);
        if (t < 0)
            t = 1;
        else
            t = 0;
    }

    while (C.size() > 1 && C.back() == 0)
        C.pop_back();

    return C;
}

int main(void)
{
    string a, b;
    cin >> a >> b;

    vector<int> A, B;
    for (auto x = a.rbegin(); x != a.rend(); x++)
        A.push_back(*x - '0');
    for (auto x = b.rbegin(); x != b.rend(); x++)
        B.push_back(*x - '0');

    if (cmp(A, B))
    {
        auto C = sub(A, B);
        for (int i = C.size() - 1; i >= 0; i--)
            printf("%d", C.at(i));
    }
    else
    {
        auto C = sub(B, A);
        printf("-");
        for (int i = C.size() - 1; i >= 0; i--)
            printf("%d", C.at(i));
    }
    return 0;
}